package Tool;

public class HexString {
    public static String parseString(byte[] b,int readCount) {//字节转化为16进制
        String ret = "";
        for (int i = 0; i < readCount; i++) {
            String hex = Integer.toHexString(b[ i ] & 0xFF);
            if (hex.length() == 1) {
                hex = '0' + hex;
            }
            ret += hex.toUpperCase()+" ";
        }
        return ret;
    }
}
